package com.itheima.app.controller;

import com.itheima.app.manager.VoiceManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.net.MulticastSocket;

@RestController
public class VoiceController {

    @Autowired
    VoiceManager voiceManager;


    @PostMapping("/peachblossom")
    public void save(MultipartFile soundFile ) throws IOException {

        voiceManager.save(soundFile);

    }

    @GetMapping("/peachblossom")
    public ResponseEntity findOne(){

        return voiceManager.findOne();
    }
}
